<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Game {
            constructor(gameName, type) {
                this.gameName = gameName
                this.type = type
            }

            say() {
                console.log('欢迎进入英雄联盟');
            }
        }

        // var game = new Game('英雄联盟', '端游')

        class Role extends Game {
            constructor(roleName, sex, hit, gameName, type) {
                super(gameName, type)
                this.roleName = roleName
                this.sex = sex
                this.hit = hit
            }

            dance() {
                console.log('开始跳舞');
            }
        }

        var role = new Role('儿童劫', '男', '54', '英雄联盟', '端游')
        console.log(role);
    </script>
</body>
</html>